<template>
  <div class="blue">
    <h1>Count</h1>
    <p>{{ count }}</p>
    <p>这是传过来的{{ num }}</p>
    <button @click="add(num)">++</button>
  </div>
</template>

<script>
export default {
  //忽略Eslint警告  /*eslint-disable*/ 
  name: "Count",
  data() {
    return {
      count: 0,
    };
  },
  props: ["num"],
  methods: {
    add(num) {
      this.count += num;
    },
  },
};
</script>

<style>
.blue {
  height: 100px;
  background-color: blue;
}
</style>